#include<iostream>
#include<string>
using namespace std;

int week(int y,int m,int d)
{
	int ans=0;
	for(int i=1;i<y;i++)
	{
		if(i%400==0||(i%4==0&&i%100!=0))
		{
			ans = ans+366%7;
			ans = ans%7;
		}
		else 
		{
			ans = ans+365%7;
			ans = ans%7;
		}

	}
	for(int j=1;j<m;j++)
	{
		if(j==1||j==3||j==5||j==7||j==8||j==10||j==12)
		{
			ans = ans+31%7;
			ans = ans%7; 
		}
		else if(j==4||j==6||j==9||j==11)
		{
			ans = ans+30%7;
			ans = ans%7;
		}
		else if(y%400==0||(y%4==0&&y%100!=0))
		{
			ans = ans+29%7;
			ans = ans%7;
		}
		else 
		{
			ans = ans+28%7;
			ans = ans%7;
		}
	}
	ans = ans+(d-1)%7;
	ans = ans%7;
	return ans;
}
int main()
{
	int y,m,d;
	cin>>y>>m>>d;
	string weekday[7]={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
	cout<<weekday[week(y,m,d)];
	return 0;
}
